<!DOCTYPE HTML> 
<html>
<head>
<meta charset="utf-8" />
<link type="text/css" href="css/main.css" rel="stylesheet">
</head>
<body> 
<p>for sql</p>
<?php
//todo:post给自己，测试一下查询，结果写入文本框
//todo:php远程连接数据库


// 定义变量并设置为空值
$nameErr = $emailErr = $genderErr = $websiteErr = "";
$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = test_input($_POST["name"]);
   
}

function test_input($data) {
   $data = trim($data);
   $data = stripslashes($data);
   $data = htmlspecialchars($data);
   return $data;
}
?>


<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> 
   姓名：<input type="text" name="name">
   <span class="error"><br>
   电邮：<input type="text" name="email">
   <span class="error"><br>
   
   <input type="submit" name="submit" value="提交"> 
</form>

<?php
echo "<h2>您的输入：</h2>";
echo $name;
echo "<br>";
echo $email;
?>



<p><a href="testphp.php">testphp</a></p>
<p><a href="testphp2.php?id=10">testphp2</a></p>
<p><a href="testphp3.php">testphp3</a></p>
<p><a href="testphp4.php">testphp4</a></p>
<p><a href="showword.html">showword</a></p>
<p><a href="update.php">update</a></p>
<p><a href="testsql.php">testsql</a></p>
<p><a href="testdate.html">testdate</a></p>
<p><a href="wordinfo.php">wordinfo</a></p>
</body>
</html>